Skip to content

fix: improve reliability and correctness of verify.sh scripts across exercises#2

Merged
sysops-26 merged 1 commit into
theplatformlab:mainfrom
nklkarthi:main
Mar 22, 2026
Merged

fix: improve reliability and correctness of verify.sh scripts across exercises#2
sysops-26 merged 1 commit into
theplatformlab:mainfrom
nklkarthi:main

Conversation

@nklkarthi
Copy link
Copy Markdown

Description
This Pull Request updates the verification scripts (verify.sh) across 14 exercise folders to improve their reliability, fix logic
errors, and ensure they correctly validate the student's work.

Key Changes:

  1. Robust Existence Checks: Standardized the way the scripts check for resources (e.g., Namespaces). Changed 2>/dev/null to

    /dev/null 2>&1 to ensure that kubectl output doesn't leak into the shell variables, preventing false positives/negatives during
    boolean evaluation.

  2. Exercise 08 (Probes) Fix: Corrected a hardcoded pod name mismatch where the script was looking for probe-pod instead of the
    required probe-test.
  3. Exercise 13 (Init Containers) Fix:
    • Added whitespace trimming (tr -d ' ') to wc -w counts. Some environments return leading/trailing spaces with wc, which caused
      integer comparisons to fail.
    • Added || true to pipe chains to prevent the script from exiting prematurely if a command in the middle of a check returns a
      non-zero exit code.
  4. Consistent Exit Handling: Improved the shell logic to ensure that "Verifying..." headers and "━━━━━━━━" separators are displayed
    correctly even if specific tasks fail.

Affected Folders:
The verify.sh file was updated in the following directories:

  • exercises/01-pod-basics through exercises/14-in-place-scaling

Verification Results:
Tested the scripts locally to ensure they now accurately report a "Pass" when the solution is correct and provide a clear "Fail" when
the resource is missing or incorrectly configured.

@sysops-26 sysops-26 merged commit 1569590 into theplatformlab:main Mar 22, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants